import request from "@/utils/request";
import type {getAttrListPrams,AttrList,AttrListItem} from './model/attrModel'

enum Api{
 getAttrListUrl ='/admin/product/attrInfoList',
getSaveAttrUrl = "/admin/product/saveAttrInfo",
delAttrUrl = "/admin/product/deleteAttr",
}

//属性列表

export const getAttrListApi=({category1Id,category2Id,category3Id}:getAttrListPrams)=>{
 return request.get<any,AttrList>(Api.getAttrListUrl+`/${category1Id}/${category2Id}/${category3Id}`)
}

// // 添加属性接口
export const getSaveAttrApi=(data:AttrListItem)=>{
return request.post<any,null>(Api.getSaveAttrUrl,data)
}
//删除属性
export const delAttrApi=(id:number)=>{
  return request.delete<any,null>(Api.delAttrUrl+`/${id}`)

}